package com.zpark.controller;

import com.zpark.i_feign.IRankingFeign;
import com.zpark.pojo.Ranking;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;

/**
 * @author xiaoyu
 * @version 1.0 2022/11/22
 */
@RestController
@RequestMapping("/feign")
public class feignController {
    @Autowired
    private IRankingFeign rankingFeign;

    @PostMapping("/all")
    public List<Ranking> all() {
        return rankingFeign.findAll();
    }

    @GetMapping("/feign_find/{id}")
    public Ranking getById(@PathVariable Integer id) {
        return rankingFeign.findById(id);
    }
}
